using System;
using System.Diagnostics;

namespace BuildAutoIncrement
{
	/// <summary>
	/// Summary description for FixedVersionProvider.
	/// </summary>
	public class FixedVersionProvider : NewVersionProvider	{

		public FixedVersionProvider(string newVersionPattern, NumberingOptions numberingOptions) : base(numberingOptions) {
            Debug.Assert(newVersionPattern != null && newVersionPattern.Length > 0);
            m_newVersionPattern = newVersionPattern;
        }

        #region INewVersionProvider Implementation

        public override string ProvideNewVersion(ProjectInfo projectInfo, BuildAutoIncrement.AssemblyVersionType assemblyVersionType, ProjectVersion highestProjectVersion) {
            return ProjectVersion.ApplyVersionPattern(m_newVersionPattern, projectInfo.CurrentAssemblyVersions[assemblyVersionType].ToString());
        }

        #endregion // INewVersionProvider Implementation

        string m_newVersionPattern;
    }
}
